Skip to content

Website: the articles as a book, with a chapter panel on every article - #124

Merged
MHiabu merged 1 commit into
masterfrom
docs-book
Nov 12, 2026
Merged

MHiabu merged 1 commit into
masterfrom
docs-book

Conversation

@MHiabu

@MHiabu MHiabu commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

The articles are now read like a book: seven numbered chapters (Get started, then the six articles) in three parts.

  • On every article page the right sidebar shows the chapters, grouped by part, with the current one highlighted. Its
    sections are nested under it and numbered (5.1, 5.2, and 5.1.1 where an article has third-level headings); the
    section in view is highlighted while scrolling. This panel replaces "On this page". The small arrow beside another
    chapter unfolds that chapter's sections.
  • The title and the headings carry the same numbers (5, 5.1, ...).
  • Each article ends with links to the previous and the next chapter.
  • On a phone the panel is a collapsed "Chapters" box below the title.
  • The articles index lists the chapters with the same numbers, by part, and Get started now appears there as chapter 1
    (with a one-line description).

The order comes from one place, articles: in _pkgdown.yml. pkgdown/extra.js reads the chapters from the
navbar that pkgdown builds from that list, so adding an article is one line in contents and the numbers after it
move up by themselves. The navbar is unchanged.

Only _pkgdown.yml, pkgdown/extra.css, the new pkgdown/extra.js and the YAML header of the Get started vignette
(a description) change; pkgdown/ is already in .Rbuildignore. No package code changes.

The articles read as numbered chapters in three parts, in the order of
`articles:` in _pkgdown.yml (Get started is chapter 1). On an article
page the right sidebar shows the chapters, with the current chapter's
sections nested and numbered (5.1, 5.1.1) and the section in view
highlighted; the other chapters' sections unfold on demand. The headings
carry the same numbers, and each article ends with links to the previous
and the next chapter. On a phone the panel is a collapsed box below the
title. The articles index numbers its entries the same way.

pkgdown/extra.js reads the chapters from the navbar that pkgdown builds
from `articles:`, so a new article is one line in that list.
@MHiabu
MHiabu merged commit 0640674 into master Nov 12, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant